# Maintainer: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Maintainer: Dan McGee <dan@archlinux.org>

pkgname=libarchive
pkgver=3.3.3
pkgrel=1
pkgdesc='Multi-format archive and compression library'
arch=(x86_64)
url='http://libarchive.org/'
license=(BSD)
depends=(acl attr bzip2 expat lz4 openssl xz zlib zstd)
provides=(libarchive.so)
source=("$pkgname-$pkgver.tar.gz::https://github.com/$pkgname/$pkgname/archive/v$pkgver.tar.gz")
sha256sums=('720da414e7aebb255fcdaee106894e4d30e2472ac1390c2c15b70c84c7479658')

prepare() {
  cd $pkgname-$pkgver 
  autoreconf -fi
}

build() {
  cd $pkgname-$pkgver 

  ./configure \
      --prefix=/usr \
      --without-xml2 \
      --without-nettle \
      --disable-static

  make
}

check() {
  cd $pkgname-$pkgver
  make check
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install
  install -Dm644 COPYING "$pkgdir/usr/share/licenses/libarchive/COPYING"
}
